{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "convenient-atmosphere",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.5464449790837185"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "a = np.random.randn(10)\n",
    "np.max(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "motivated-tension",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([88, 88, 88, 99, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.arange(15)\n",
    "a[3] = 99\n",
    "b = np.arange(15)\n",
    "b[:] = 88\n",
    "np.maximum(a, b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "consecutive-zambia",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 3 4]\n",
      "[0 1 2 3 4]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([[120, 130, 140, 150],\n",
       "       [320, 355, 390, 425],\n",
       "       [520, 580, 640, 700]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 点乘 - 两个等长的向量(a1, a2, a3)\n",
    "a = np.arange(5)\n",
    "print(a)\n",
    "b = np.arange(5)\n",
    "print(b)\n",
    "np.dot(a, b)\n",
    "\n",
    "# 矩阵点乘的shape必须满足(x, y), (y, z)关系。\n",
    "# 第一个矩阵的列，必须和第二个列的长度一样。\n",
    "a = np.arange(15).reshape(3, 5)\n",
    "b = np.arange(20).reshape(5, 4)\n",
    "np.dot(a, b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "usual-consequence",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "anticipated-amino",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
